package com.freecloud.javabasics.javap;

/**
 * 测试构造函数字节码
 * @Author: maomao
 * @Date: 2019-11-21 15:48
 */
public class ConstructionJavap {

    public static void main(String[] args) {

        Test1 t1 = new Test1(new Test2());

        Test2 t2_1 = getTest2();

        Test1 t2 = new Test1(t2_1);

        Test1 t3 = new Test1(getTest2());
    }

    public static Test2 getTest2(){
        Test2 t2 = new Test2();
        return t2;
    }
}


class Test1{

    private Test2 test2;

    public Test1(Test2 test2){
        this.test2 = test2;
    }
}

class Test2{
    public Test2(){}
}